<template>
  <div id="noticeUser">
    <div slot="header" class="clearfix">
          <span>BeijiRonin</span>
          <el-button
            style="float: right; margin-right: 10%"
            type="text"
            @click="load()">刷新</el-button>
    </div>
    <el-table 
    :data="datas" style="width: 100%"
    v-loading="loading"
    element-loading-text="拼命加载中"
    element-loading-spinner="el-icon-loading"
    element-loading-background="rgba(0, 0, 0, 0.8)"
    >
      <el-table-column prop="id" label="索引"> </el-table-column>
      <el-table-column prop="content" label="通知"> </el-table-column>
      <el-table-column prop="createTime" label="通知时间"> </el-table-column>
      <el-table-column prop="userId" label="用户ID"> </el-table-column>
    </el-table>
  </div>
</template>
<script>
export default {
  name: "noticeUser",
  data() {
    return {
      datas: [],
    };
  },
  methods:{
    load() {
      this.loading = true;
      this.datas = [];
      this.axios
        .post(`http://localhost:4578/all_json/violationList`, {})
        .then((ret) => {
          this.datas = ret.data;
          this.loading = false;
        });
    },
  },
  mounted() {
    this.load();
  },
};
</script>
